package com.sgz.androidlib.others.sample;

import android.os.Bundle;

import com.android.sgzcommon.activity.BaseActivity;
import com.android.sgzcommon.recycleview.MarginDecoration;
import com.android.sgzcommon.view.TitleBar;
import com.sgz.androidlib.R;
import com.sgz.androidlib.others.sample.adapter.RecyclerViewDecorationAdapter;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author sgz
 * @date 2021-02-20
 */
public class TestRecyclerViewDecorationActivity extends BaseActivity {

    @BindView(R.id.tb_title)
    TitleBar mTbTitle;
    @BindView(R.id.rv_list)
    RecyclerView mRvList;

    private RecyclerViewDecorationAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recyclerview_decoration);
        ButterKnife.bind(this);
        List<String> list = new ArrayList<>();
        for (int i = 1; i <= 10; i++) {
            list.add("第 " + i + " 项");
        }
        mAdapter = new RecyclerViewDecorationAdapter(this,list);
        mRvList.setLayoutManager(createLinearLayoutManager(RecyclerView.VERTICAL));
        MarginDecoration marginDecoration= new MarginDecoration(0,10,false);
        mRvList.addItemDecoration(marginDecoration);
        mRvList.setAdapter(mAdapter);
    }
}
